/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.sgc.view.mbean;

import com.brain.core.dto.ParametroDto;
import com.brain.core.manager.RecursosManager;
import com.brain.core.view.mbean.ApplicationMBean;
import com.brain.core.view.mbean.GenericMBean;
import com.brain.core.view.mbean.SessionMBean;
import com.brain.core.view.util.ConstantesCore;
import com.brain.sgc.dto.IdiomaDto;
import com.brain.sgc.manager.IdiomaManager;
import com.brain.sgc.view.util.ConstantesSgc;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

/**
 *
 * @author Christian
 */
@Controller("idiomaMBean")
@Scope("session")
public class IdiomaMBean extends GenericMBean implements Serializable {
    private static Logger logger = Logger.getLogger(IdiomaMBean.class);
    @Resource
    private IdiomaManager manager;
    @Resource
    private RecursosManager recursosManager;
    private List<IdiomaDto> lista;
    private IdiomaDto dto;
    private String keyTitulo = "idioma.panel";
    @Autowired
    private ApplicationMBean applicationMBean;
    @Autowired
    private SessionMBean sessionMBean;
    
    public IdiomaMBean() {
        
    }
    
    public String iniciar() {
        this.setDto(null);
        this.setLista(null);
        return "";
    }

    public String nuevo() {
        getSessionMBean().setAccion(ConstantesSgc.Formulario.NUEVO);
        getSessionMBean().setTitulo(getRecursosManager().construirTitulo( getKeyTitulo(), getSessionMBean().getAccion()));
        this.setLista(new ArrayList<IdiomaDto>());
        this.setDto(new IdiomaDto());
        return "";
    }

    public IdiomaManager getManager() {
        return manager;
    }

    public void setManager(IdiomaManager manager) {
        this.manager = manager;
    }

    public RecursosManager getRecursosManager() {
        return recursosManager;
    }

    public void setRecursosManager(RecursosManager recursosManager) {
        this.recursosManager = recursosManager;
    }

    public List<IdiomaDto> getLista() {
        return lista;
    }

    public void setLista(List<IdiomaDto> lista) {
        this.lista = lista;
    }

    public IdiomaDto getDto() {
        return dto;
    }

    public void setDto(IdiomaDto dto) {
        this.dto = dto;
    }

    public String getKeyTitulo() {
        return keyTitulo;
    }

    public void setKeyTitulo(String keyTitulo) {
        this.keyTitulo = keyTitulo;
    }

    public ApplicationMBean getApplicationMBean() {
        return applicationMBean;
    }

    public void setApplicationMBean(ApplicationMBean applicationMBean) {
        this.applicationMBean = applicationMBean;
    }

    public SessionMBean getSessionMBean() {
        return sessionMBean;
    }

    public void setSessionMBean(SessionMBean sessionMBean) {
        this.sessionMBean = sessionMBean;
    }
}
